package eu.liquify.ui {
	import flash.display.DisplayObject;
	import flash.display.Graphics;
	import flash.text.TextFormat;
	public class MultiTabButton extends Button {
		public static const LEFT:int = 0;
		public static const MIDDLE:int = 1;
		public static const RIGHT:int = 2;
		public static const SINGLE:int = 3;
		
		public var style:int = MIDDLE;
		
		public function MultiTabButton() {
			toggle = true;
			selected = true;
			handleEvents = false;
			animate = false;
			height = 30;
		}
		
		override protected function redraw(draw:Boolean = true):void {
			if (draw) {
				var g:Graphics = background.graphics;
				g.clear();
				g.lineStyle(1, 0x424FC1, 1, true);
				g.beginFill(0xFFFFFF);
				drawRect(g);
				g.beginFill(0x658FFE, trans);
				drawRect(g);
			}
			
			super.redraw(false);
		}
		
		private function drawRect(g:Graphics):void {
			var corner:Number = 8;
			switch (style) {
				case MIDDLE: g.drawRect(0, 0, width, height); break;
				case LEFT: g.drawRoundRectComplex(0, 0, width, height, corner, 0, corner, 0); break;
				case RIGHT: g.drawRoundRectComplex(0, 0, width, height, 0, corner, 0, corner); break;
				case SINGLE: g.drawRoundRect(0, 0, width, height, corner, corner); break;
			}
		}
		
	}

}